// JavaScript Document
var xmlHttp;
	function setXmlHttpRequest()
{
	if(window.ActiveXObject)
	{
		xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
		}
		else if(window.XMLHttpRequest)
		{
			xmlHttp = new XMLHttpRequest();
			}
	}
	
	function ajaxFunRegist(url,funName)
	{
		setXmlHttpRequest();
		url = encodeURI(url);
		xmlHttp.open("GET",url,true);
		xmlHttp.onreadystatechange = funName;
		xmlHttp.send(null);
		}
		function getZhy(obj)
		{
			var value = obj.value;
			//alert(value);
			if(value != "none")
			{
			var url = "control.php?action=getZhyAjax&xyid="+value;
			ajaxFunRegist(url,setZhy);
			}
			}
			function setZhy()
			{
	
				if(xmlHttp.readyState == 4)
				{
					if(xmlHttp.status == 200)
					{
				var content = xmlHttp.responseText;
			
				var zhy = document.getElementById('zhySpan');
				zhy.innerHTML = content;
				}
				}
				}
				function getBJ(obj)
				{
					var value = obj.value;
					var url = "control.php?action=getBJAjax&zhyid="+value;
			       ajaxFunRegist(url,setBJ);
					}
					function setBJ()
					{
					if(xmlHttp.readyState == 4)
					{
						if(xmlHttp.status == 200)
						{
							
						var content = xmlHttp.responseText;
						var  bj = document.getElementById('bjSpan')
						bj.innerHTML = content;
						}
					}
						}